
#ifndef __DUCKLING__Spring__
#define __DUCKLING__Spring__

#include "cocos2d.h"
#include <Box2D/Box2D.h>
#include "ADUConfig.h"

USING_NS_CC;


class Spring{
public:
	float mX;
	float mY;
	float mSpeed;


    Spring();
    ~Spring();
    void SetOriginPos(Vec2);
    void OnUpdate(float);
    void SetSpeed(float);
    Vec2 GetPos();
    void SetId(int);

    void ChangeYSurface(float y);
    void IncreaseHeight(float dy);
private:
    constexpr static const float k = 0.025f;
    constexpr static const float mTension = 0.025f;
    constexpr static const float mDamping = 0.025f;

    int mId;

    float mMaxDecrease;
    float mMaxIncrease;
    
    float mDispalcement;
    float mYSurface;

};


#endif
